package com.dailyblue.java.standard.design.工厂模式.简单工厂模式;

// 一个简单工厂，负责生产手机
public class PhoneFactory {

    public static Phone makePhone(int type) {
        if (type == 1) {
            return new Iphone();
        } else if (type == 2) {
            return new MiPhone();
        } else if (type == 3) {
            return new MetaPhone();
        }
        throw new RuntimeException("不支持这个手机型号！");
    }
}
